UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6ROjk8Cod1MgvXXq/+6taC443gBkBqWRLI6sXliUB/I='
WHERE
key_id = '31219bbb6f90efed1a99ade870cc1fec5f1d4615d8ebca4b4ad076b6acf158db'
AND (
token = '6ROjk8Cod1MgvXXq/+6taC443gBkBqWRLI6sXliUB/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)