UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GDMNINHnEQEZe8JcXiPvEHE9VAHhTgoS5tOJpBgP46s='
WHERE
key_id = 'e40153e35c640d1113902080f3e4477f2d77bd1bd13cb3bbce592c0d1d56a386'
AND (
token = 'GDMNINHnEQEZe8JcXiPvEHE9VAHhTgoS5tOJpBgP46s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)