UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0VWAuoAzO/5GUcJFPHEsxhtfy8X3elfw49tnjOT+t84=' 
WHERE 
  key_id = '2da009f3becffa837ba146d0339d5f8a0bb0f2e2d8bc60e788a9e7fcb3e57ca9' 
  AND (
    token = '0VWAuoAzO/5GUcJFPHEsxhtfy8X3elfw49tnjOT+t84=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039