UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yesJIcfCQsdSc4B8LoFaGddH/UygXNGgkALRSBhAug8=' 
WHERE 
  key_id = 'ecff281e14160eddb784572a356016fe1043d23ab6581d8282bd8464e78fc44d' 
  AND (
    token = 'yesJIcfCQsdSc4B8LoFaGddH/UygXNGgkALRSBhAug8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061