UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '886ZCRzTkYLXFHo10wGEuo3S1qNKJEE6gtjAmkDJhbU='
WHERE
key_id = '63f2cb72252a631b10142e00b30d5bf61dbdb29e65b7c489fc1375419bc47c2e'
AND (
token = '886ZCRzTkYLXFHo10wGEuo3S1qNKJEE6gtjAmkDJhbU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)