UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9+J6QztUvMnQlkKMYvuliv74zf39/KwShxIOHCSaYrE='
WHERE
key_id = '3cbf2e9527bc703ba2530642ace2964be87cddb2a292f92b181ae2e4be5de008'
AND (
token = '9+J6QztUvMnQlkKMYvuliv74zf39/KwShxIOHCSaYrE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)