UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1KAs4hxfJpYQDVckwCJ/oxBUKS4DSwW32uvWWY7JGSY='
WHERE
key_id = '7340dc1d00678a0728b063888e0fb98ae50975e0867b77f8042a8e151b5c1c81'
AND (
token = '1KAs4hxfJpYQDVckwCJ/oxBUKS4DSwW32uvWWY7JGSY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)