UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R4GtNEYydFx9zdkDSe+kxJhPLrBphxKhJ+znfZTh4Y0='
WHERE
key_id = '586c8ed44f7842b0ccd4ca3823af53a264a424ef0a29e2573fc48ded78a1f34a'
AND (
token = 'R4GtNEYydFx9zdkDSe+kxJhPLrBphxKhJ+znfZTh4Y0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)