UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rd3JeHeRelTIm08hIhsfegtB1/GFmfphMjC1gPRkHdk=' 
WHERE 
  key_id = 'b43cfb8982df9bd2641980a6a34a9450cc029cf5fe2d0bd4810c1f3deba27b66' 
  AND (
    token = 'rd3JeHeRelTIm08hIhsfegtB1/GFmfphMjC1gPRkHdk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015