UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mb/CvCR5v21n1Cq2r1CrZlBuwSy+hWnEA0c8FRFQR0s='
WHERE
key_id = '3de5915560f467ec7c59a7afc8c8f3c135d11e6e555b18bcb66d92903938dfff'
AND (
token = 'Mb/CvCR5v21n1Cq2r1CrZlBuwSy+hWnEA0c8FRFQR0s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)