UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pL+UCSvtKsCdExjDT4xhLW78wA6fxKlUYWMcas4BuzA='
WHERE
key_id = '7f2266d274004c5ec433e0970b9f3e6db82197c3f695bef97d92ecd76924f9de'
AND (
token = 'pL+UCSvtKsCdExjDT4xhLW78wA6fxKlUYWMcas4BuzA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)