UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0cQKJgcU2QIwLasi726fTy6itJzW8rGv6gbKjJgfciE='
WHERE
key_id = '5f08ef08b983168666cf99a948d906c52c672abdcd1296c87d32324c3c178815'
AND (
token = '0cQKJgcU2QIwLasi726fTy6itJzW8rGv6gbKjJgfciE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)