UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VdSVtxqZAn34+gnouIPvxaR3MR9AkCTgSp+a+vR4CbY=' 
WHERE 
  key_id = 'e0c128966bf852f7008a5056e1af06d30d58bb5ba707d0b4888f1d84fa8f27f2' 
  AND (
    token = 'VdSVtxqZAn34+gnouIPvxaR3MR9AkCTgSp+a+vR4CbY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026