UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x7b5K4R1jud9W/gitSmT5T6tecJ50npltUFGKCZQM6A=' 
WHERE 
  key_id = '6e02a52fe2298df7b71fc12c42c01252b190db38de1f7d5ddbdae5b9ac44bf22' 
  AND (
    token = 'x7b5K4R1jud9W/gitSmT5T6tecJ50npltUFGKCZQM6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042