UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pjYzW60U5BkhC4Cm/gDUoxGV0YNV0lnfvQnLS/28Yeg='
WHERE
key_id = 'd4d8a8dfadf217a58f9c2d1b9c70570720b27d64a0af7af2c9dbfbeadaf6be4e'
AND (
token = 'pjYzW60U5BkhC4Cm/gDUoxGV0YNV0lnfvQnLS/28Yeg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)