UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AAJtm3NYOEs6XDgqXyfybHc78W8Oqdu/3LSZRAD3VNo='
WHERE
key_id = '40fcac160e81d53068cdc61a89b5686b588423a38fcbaf8d169124d7749fced2'
AND (
token = 'AAJtm3NYOEs6XDgqXyfybHc78W8Oqdu/3LSZRAD3VNo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)