UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AtR3V+4ZzHtEqFsMxC97UQFpu2sgR2tr7P6Zzzc1lBM=' 
WHERE 
  key_id = '2b94a89dfae593e521cef2f6284c5334128874c5836a50788d7ede54929d2d34' 
  AND (
    token = 'AtR3V+4ZzHtEqFsMxC97UQFpu2sgR2tr7P6Zzzc1lBM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029