UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Iz9dDRrPsorNG4U/lypYLZGt4qtCnrDNXW4vo1/rASo=' 
WHERE 
  key_id = '18ca10dc0fd37f0bd75e53c7d6ed9e605499a45903d0b514869d2277dd587c82' 
  AND (
    token = 'Iz9dDRrPsorNG4U/lypYLZGt4qtCnrDNXW4vo1/rASo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029