UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jg2hm6uwrSEVUN5yvSbIepgkdn6F8kD8mNzA9pyG/V8='
WHERE
key_id = 'dfb99b80cf3a5d1cd615547d699ee3ea5e35cb212b1a4d771d69043af1dcfe06'
AND (
token = 'Jg2hm6uwrSEVUN5yvSbIepgkdn6F8kD8mNzA9pyG/V8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)