UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cMGooVnWXKzw8ga/JWDE++QKj8vn0ynRvIsR6cmpYnA='
WHERE
key_id = 'fd744052932a400f1ae1976d4feddf78c4b7bd51342cde8496caf0f80ccc8f22'
AND (
token = 'cMGooVnWXKzw8ga/JWDE++QKj8vn0ynRvIsR6cmpYnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)