UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b68C6h/iQRJixy9a5IiDIjko7OJzOy6BBKRDja/4VZk=' 
WHERE 
  key_id = '87866a3d0b6b6c8f2b9be0625c6b982bcb96e94dc89ee6b8675b9f253f57c503' 
  AND (
    token = 'b68C6h/iQRJixy9a5IiDIjko7OJzOy6BBKRDja/4VZk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039