UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oABvCirfd2TNziFqHj91Qc+Bi0recI8TI779vyo24o0='
WHERE
key_id = '1d5d3d91778f3bc01f78135bc98a17e3279b27adc50d1a5a55060ce399775f55'
AND (
token = 'oABvCirfd2TNziFqHj91Qc+Bi0recI8TI779vyo24o0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)