UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UmBaskG1T2M4acabqOk+efEVu7X8PeV+gwCJu2hyXKQ=' 
WHERE 
  key_id = 'b024f4c8f55e62c5e06f8f4363ad5490255801659919700afae5370f2cb710a9' 
  AND (
    token = 'UmBaskG1T2M4acabqOk+efEVu7X8PeV+gwCJu2hyXKQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027