UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/02GqhC57J+Z93v80A1aP/RnI+4yhLqA6gPdp9mBhuk='
WHERE
key_id = 'a72bd380e998301d3a520731bf9c9044dcb9b2882e98a7e938a8fec0bfbf1021'
AND (
token = '/02GqhC57J+Z93v80A1aP/RnI+4yhLqA6gPdp9mBhuk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)