UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ho6R4dOftaH7uKefoaYwACNEY1Bv/Di6700HgfEL3zo=' 
WHERE 
  key_id = '1c46e1a1a61744ab519bcd9a84bfdf9778100845201d25b402e4d4f257cfcb40' 
  AND (
    token = 'ho6R4dOftaH7uKefoaYwACNEY1Bv/Di6700HgfEL3zo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035