UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gcwdl0knq6kcsQ4Y1/18rd5oBCyEDhkGwMShcS44KNI='
WHERE
key_id = 'a378691bdebcc6dafa89db311ea62e5e52886d4390fc199e1326c98ba0fa9095'
AND (
token = 'gcwdl0knq6kcsQ4Y1/18rd5oBCyEDhkGwMShcS44KNI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)