UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f6gx2unHQO7B8De3WpFX0cVMnaWFwfR9Be8RPBciP5Y='
WHERE
key_id = '01936a4bcfd904059b1ffd7110bccf86b14ac1db32f7ef4862f04d3595684db2'
AND (
token = 'f6gx2unHQO7B8De3WpFX0cVMnaWFwfR9Be8RPBciP5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)