UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c1KGGjqQoqEvBXqCKHno8MykSRD3AcmSHGhx8H8bFPk='
WHERE
key_id = '2107e095a71ceb894c4708ca8d6f22f588981313a04e5b39973f148fc7d70cd7'
AND (
token = 'c1KGGjqQoqEvBXqCKHno8MykSRD3AcmSHGhx8H8bFPk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)