UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pMdFHSNkflIcrlxabvqnBtYtw4A6Eog+z2XTfrPpbuc='
WHERE
key_id = 'e97d6a8eb1b45c8b9f9fa93bf9e1ae111ed260e981c88fd275049242ead59a62'
AND (
token = 'pMdFHSNkflIcrlxabvqnBtYtw4A6Eog+z2XTfrPpbuc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)