UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4RgyvZttS07zaTFlqOkxvrPYTDTnhmmLNKkB7h6JD9w='
WHERE
key_id = '2748a29049f2443eee1960511b18ee15b1879311efb3c00071a661d98d19df5e'
AND (
token = '4RgyvZttS07zaTFlqOkxvrPYTDTnhmmLNKkB7h6JD9w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)