UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vh3nFPVNorm7zaZFyOa6a9PDYwzU5NrDMHxJ41TOX6w='
WHERE
key_id = '18259d6d6c138145a824616de8bd601ae9e0b2419f57acc64f1c350c97f2311a'
AND (
token = 'vh3nFPVNorm7zaZFyOa6a9PDYwzU5NrDMHxJ41TOX6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)