UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1djgTCcq1BcUP7rKbkE7oCoT3jb1bcuT6Iw3iq0FVBc='
WHERE
key_id = '5cd0a0884fc6fb788b2708c67a2106e0e5359a5107472710ca35d3feb7280d41'
AND (
token = '1djgTCcq1BcUP7rKbkE7oCoT3jb1bcuT6Iw3iq0FVBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)